package com.java.frontweb.config;

import com.java.frontweb.intercepters.UserLoginHandlerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @ClassName InterceptorConfig
 * @Description 拦截器配置
 * @Author Trigger Wu
 * @Date 2018/9/2223:06
 * @Version 1.0
 **/
@SpringBootConfiguration
public class InterceptorConfig  implements WebMvcConfigurer {
    @Autowired
    private UserLoginHandlerInterceptor  userLoginHandlerInterceptor;
/*
 *  拦截器设置
 * 
 * @author Tigger Wu
 * @date 2018/9/22 23:11
 * @param [registry]
 * @return void
 */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userLoginHandlerInterceptor).addPathPatterns("/rest/order/**");
    }
}
